import 'dart:convert';
import 'package:x3_base_package/x3_base_package.dart';
import 'package:x3_business_core/common_models/user_model.dart';

/// author：william on 2021/3/16 16:04
/// email：362661044@qq.com
class UserPosModel extends UserModel {
  UserPosModel({
    this.img,
    this.userName,
    this.userPosId,
    bool check,
  }) : super(img: img, userName: userName, userId: userPosId, check: check);

  factory UserPosModel.fromJson(Map<String, dynamic> jsonRes) => jsonRes == null
      ? null
      : UserPosModel(
          img: asT<String>(jsonRes['img']),
          userName: asT<String>(jsonRes['userName']),
          userPosId: asT<String>(jsonRes['userPosId']),
          check: asT<bool>(jsonRes['check']),
        );

  String img;
  String userName;
  String userPosId;

  Map<String, dynamic> toJson() => <String, dynamic>{
        'img': img,
        'userName': userName,
        'userPosId': userPosId,
        'check': check,
      };
  @override
  String toString() {
    return json.encode(this);
  }
}
